﻿@{
    ViewBag.Title = "调查问卷";
}
@section header{

}
<form id="form1">
    <div class="form-layout">
        <input type="hidden" name="ID" value="" />
        <input type="hidden" id="OrderBy" name="OrderBy" value="" />
        <input type="hidden" id="AddTime" name="AddTime" value="" />
        <table class="form">

            <tr>
                <th class="formTitle">问卷名称</th>
                <td class="formValue">
                    <input id="SurName" name="SurName" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">描述</th>
                <td class="formValue">
                    <input id="SurContent" name="SurContent" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">共享</th>
                <td class="formValue">
                    <input id="IsShare" name="IsShare" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">发布方式</th>
                <td class="formValue">
                    <input id="FilterModel" name="FilterModel" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">创建时间</th>
                <td class="formValue">
                    <input id="CreateTime" name="CreateTime" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">完成情况</th>
                <td class="formValue">
                    <input id="Completed" name="Completed" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">状态</th>
                <td class="formValue">
                    <input id="SurStatus" name="SurStatus" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">收集量</th>
                <td class="formValue">
                    <input id="CollectionAmount" name="CollectionAmount" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">已收集数量</th>
                <td class="formValue">
                    <input id="Amounted" name="Amounted" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">目标用户</th>
                <td class="formValue">
                    <input id="TargetUser" name="TargetUser" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">质量控制</th>
                <td class="formValue">
                    <input id="QualityControl" name="QualityControl" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">调研结果</th>
                <td class="formValue">
                    <input id="SurResult" name="SurResult" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">内容</th>
                <td class="formValue">
                    <input id="JSONContent" name="JSONContent" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">预览JSON</th>
                <td class="formValue">
                    <input id="JSONPreview" name="JSONPreview" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">发布JSON</th>
                <td class="formValue">
                    <input id="JSONPublish" name="JSONPublish" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">发布时间</th>
                <td class="formValue">
                    <input id="PublishTime" name="PublishTime" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">收集开始时间</th>
                <td class="formValue">
                    <input id="SurStartDate" name="SurStartDate" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">收集结束时间</th>
                <td class="formValue">
                    <input id="SurEndDate" name="SurEndDate" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">未锁定</th>
                <td class="formValue">
                    <input id="IsUnlocked" name="IsUnlocked" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">在线</th>
                <td class="formValue">
                    <input id="IsOnline" name="IsOnline" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">投票类型</th>
                <td class="formValue">
                    <input id="VoteType" name="VoteType" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">有效开始时间</th>
                <td class="formValue">
                    <input id="EnableDate" name="EnableDate" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">有效截止时间</th>
                <td class="formValue">
                    <input id="DisableDate" name="DisableDate" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>



        </table>
    </div>
</form>

@section scripts{
    <script>
        var baseUrl = "/Survey/SurQuestionNaire/";
        var keyValue = $.request("keyValue");
        $(function () {
            initControl();
            if (!!keyValue) {
                $.ajax({
                    url: baseUrl + "GetFormJson",
                    data: { keyValue: keyValue },
                    dataType: "json",
                    async: false,
                    success: function (data) {
                        $("#form1").formSerialize(data);
                    }
                });
            }
        });
        function initControl() {

        }
        function submitForm() {
            if (!$('#form1').formValid()) {
                return false;
            }
            $.submitForm({
                url: baseUrl + "SubmitForm?keyValue=" + keyValue,
                param: $("#form1").formSerialize(),
                success: function () {
                    $.currentWindow().$("#gridList").resetSelection();
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                }
            })
        }
    </script>
}